import request, {
  Method
} from '@/utils/request.js'

// 单人livekit-start

// 开始拨号
export function singleCall(params) {
  return request.ajax({
    url: `/livekit/p2p/call`,
    method: 'POST',
	needToken: true,
	isJson:true,
    params
  })
}
// 接受通话
export function singleAccept(params) {
  return request.ajax({
    url: `/livekit/p2p/accept`,
    method: 'POST',
	needToken: true,
	isJson:true,
    params
  })
}
// 正忙
export function singleBusy(params) {
  return request.ajax({
    url: `/livekit/p2p/busy`,
    method: 'POST',
	needToken: true,
	isJson:true,
    params
  })
}
// 拒绝
export function singleRegect(params) {
  return request.ajax({
    url: `/livekit/p2p/reject`,
    method: 'POST',
	needToken: true,
	isJson:true,
    params
  })
}
// 结束
export function singleFinish(params) {
  return request.ajax({
    url: `/livekit/p2p/finish`,
    method: 'POST',
	needToken: true,
	isJson:true,
    params
  })
}

// 取消
export function singleCancel(params) {
  return request.ajax({
    url: `/livekit/p2p/cancel`,
    method: 'POST',
	needToken: true,
	isJson:true,
    params
  })
}
// 响铃
export function singleRing(params) {
  return request.ajax({
    url: `/livekit/p2p/ring`,
    method: 'POST',
	needToken: true,
	isJson:true,
    params
  })
}


// 单人livekit-end





// 会议livekit-start
// 创建房间
export function createMeet(data) {
  return request.ajax({
    url: `/livekit/meeting/create`,
    method: 'POST',
	needToken: true,
	isJson:true,
    data
  })
}
export function callMeet(data) {
  return request.ajax({
    url: `/livekit/meeting/ring`,
    method: 'POST',
	needToken: true,
	isJson:true,
    data
  })
}
// 再次邀请
export function callMeetAgain(data) {
  return request.ajax({
    url: `/livekit/meeting/invite`,
    method: 'POST',
	needToken: true,
	isJson:true,
    data
  })
}

// 获取房间token
export function getRoomToken(params) {
  return request.ajax({
    url: `/livekit/meeting/token`,
    method: 'get',
	needToken: true,
	isJson:true,
    params
  })
}
// 禁言
export function setMicOff(params) {
  return request.ajax({
    url: `/livekit/meeting/room/mute`,
    method: 'post',
	needToken: true,
	isJson:true,
    params
  })
}
// 解除禁言
export function setMicOn(params) {
  return request.ajax({
    url: `/livekit/meeting/room/mute`,
    method: 'delete',
	needToken: true,
	isJson:true,
    params
  })
}
// 关闭成员麦克风
export function setMemberMicOff(data) {
  return request.ajax({
    url: `/livekit/meeting/member/audio-off`,
    method: 'post',
	needToken: true,
	isJson:true,
    data
  })
}
// 开启成员麦克风
export function setMemberMicOn(data) {
  return request.ajax({
    url: `/livekit/meeting/member/audio-on`,
    method: 'post',
	needToken: true,
	isJson:true,
    data
  })
}
// 关闭成员摄像头
export function setMemberCamOff(data) {
  return request.ajax({
    url: `/livekit/meeting/member/camera-off`,
    method: 'post',
	needToken: true,
	isJson:true,
    data
  })
}
// 开启成员摄像头
export function setMemberCamOn(data) {
  return request.ajax({
    url: `/livekit/meeting/member/camera-on`,
    method: 'post',
	needToken: true,
	isJson:true,
    data
  })
}
// 发送消息
export function sendMessage(data) {
  return request.ajax({
    url: `/livekit/meeting/message`,
    method: 'post',
	needToken: true,
	isJson:true,
    data
  })
}
// 获取房间信息
export function getRoomInfo(params) {
  return request.ajax({
    url: `/livekit/meeting/room`,
    method: 'get',
	needToken: true,
	isJson:true,
    params
  })
}
// 拒绝会议
export function rejectMeet(params) {
  return request.ajax({
    url: `/livekit/meeting/reject`,
    method: 'post',
	needToken: true,
	isJson:true,
    params
  })
}

// 邀请参加会议
export function inviteMeet(data) {
  return request.ajax({
    url: `/livekit/meeting/invite`,
    method: 'post',
	needToken: true,
	isJson:true,
    data
  })
}

// 发送预约会议
export function sendOrderMeet(data) {
  return request.ajax({
    url: `/livekit/meeting/ding`,
    method: 'post',
	needToken: true,
	isJson:true,
    data
  })
}
// 踢出会议
export function kickOutMeet(data) {
  return request.ajax({
    url: `/livekit/meeting/kick-out`,
    method: 'post',
	needToken: true,
	isJson:true,
    data
  })
}

// 结束会议
export function finishMeet(params) {
  return request.ajax({
    url: `/livekit/meeting/finish`,
    method: 'post',
	needToken: true,
	isJson:true,
    params
  })
}
// 会议livekit-end


